package linked;

public class Main {

    public static void main(String[] args) {
        LinkedList1<Integer> linkedList = new LinkedList1();
//        LinkedList<Integer> linkedList = new LinkedList();

        linkedList.addFirst(5);
        linkedList.addFirst(4);
        linkedList.addFirst(3);
        linkedList.addFirst(2);
        linkedList.addFirst(1);

        System.out.println(linkedList);

        linkedList.add(2,666);

        System.out.println(linkedList);

        linkedList.addLast(777);

        System.out.println(linkedList);

        Integer first = linkedList.get(0);
        System.out.println(first);

        Integer last = linkedList.get(6);
        System.out.println(last);

        Integer delValue = linkedList.remove(2);
        System.out.println(delValue);

        System.out.println(linkedList);

        Integer last1 = linkedList.removeLast();
        System.out.println("last: "+last1);
        System.out.println(linkedList);

        Integer first1 = linkedList.removeFirst();
        System.out.println(first1);
        System.out.println(linkedList);

    }

}
